<?

class Account_module extends Module
{
	public $version = '1.0';
    public $name = 'account';
	public function info()
	{
		return array(
			'name' => 'Account',
			'backend_uri' => 'account',
			'description' => 'Frontend account options',
			'frontend' => true,
			'backend'  => false,
			'menu'	  => 'design'
		);
	}
   
   public function routes()
   {
        return array(
                array(
                    'slug' => 'account_profile',
                    'name' => 'User profile',
                    'uri' => 'account/view/{id}',
                    'items' => $this->db->from('users')->get()->result_array()                   
                ),
                array(
                    'slug' => 'account_password',
                    'name' => 'Change password',
                    'uri' => 'account/password'
                ),
                array(
                    'slug' => 'account_forgot',
                    'name' => 'Forgot password',
                    'uri' => 'account/forgot'
                ),
                array(
                    'slug' => 'account_login',
                    'name' => 'Login',
                    'uri' => 'account/login'
                ),
                array(
                    'slug' => 'account_logout',
                    'name' => 'Logout',
                    'uri' => 'account/logout'
                )
                
            );    
   }

    public function install()
    {
        // Generate extra site permissions
        $this->load->dbforge();
        $fields = array('site_view_profile'     => array('type' => 'TINYINT', 'default' => 0, 'NULL' => FALSE),
                        'site_change_pasword'   => array('type' => 'TINYINT', 'default' => 0, 'NULL' => FALSE)
                        );
        $this->dbforge->add_column('groups', $fields);
    }
    
    public function uninstall()
    {
        
    }
    
    
    
}